<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>短信内容配置</title>
    <link href="../../layui/css/layui.css" rel="stylesheet" type="text/css">
    <link href="../../css/style.css" rel="stylesheet" type="text/css">
    <script src="../../layui/layui.js"></script>
    <script src="../../js/jquery-1.8.3.js"></script>
    <script src="../../js/util.js"></script>
    <script type="text/javascript">
        layui.use(['layer', 'form', 'jquery', 'element'], function () {
            var table = layui.table;
            var layer = layui.layer;
            var form = layui.form;
            var $ = layui.$;
            var mgrId=getUrlParam("mgrId");
            var cityId=getUrlParam("cityId");

            form.on('submit(commit)', function(data){
               var content=$("#content").val();
               var param={
                   cityId:cityId,
                   mgrId:mgrId,
                   content:content
               };
               var url="/content/addContent";
                $.ajax({
                    type: 'post',
                    async: false,
                    url: url,
                    data: param,
                    beforeSend: function () {
                        loading = layer.load(0, {shade: false});
                    },
                    success: function (json) {
                        layer.close(loading);
                        var data = json.data;
                        if (json.code == 0) {
                            layui.use('layer', function () {
                                layer.msg('内容配置成功，点击 确定 返回内容管理界面', {
                                    time: 0 //不自动关闭
                                    , btn: ['确定']
                                    , yes: function (index) {
                                        layer.close(index);
                                        location.href = "smsContentManage.html";
                                    }
                                });
                            });
                        } else {
                            layer.msg(json.msg);
                        }
                    }
                    ,
                    error: function (data) {
                        layer.msg('系统异常，请联系管理员处理!');
                    }
                });
                return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
            });
        });
    </script>
</head>
<body>
<div class="layui-html-limit">
    <div class="layui-content-body">
        <div class="scroll-box">
            <div class="breadcrumb-box">
              <span class="layui-breadcrumb" lay-separator="|">
  <a href="javascript:returnIndex2()">首页&nbsp;</a>
  <a href="smsContentManage.html"> &nbsp;短信内容配置管理&nbsp; </a>
  <a href=""> &nbsp;短信内容配置&nbsp; </a>
</span>
            </div>
            <div class="content-box">
                <form class="layui-form layui-form-pane" >
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">短信内容</label>
                        <div class="layui-input-block">
                            <textarea  class="layui-textarea" id="content" lay-verify="required"></textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <button class="layui-btn layui-btn-normal"  lay-submit lay-filter="commit">提交</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</body>
</html>